<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;

class StorageUnlock extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'storage-unlock';

    private $lockKey = 'storageProcessStatus';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '清除进程锁';

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        $this->unlock();
        echo "Storage解锁" . PHP_EOL;
    }

    private function unlock()
    {
        Redis::set($this->lockKey, 'exit');
    }
}
